/*
 * T.Raynal - A.Aviles - F.Diallo
 * XML-Scenarios
 * PPA AL5-2
 * December 2012 
 */
package trash;

import java.util.Iterator;

import model.scenario.UnregisteredComponentException;
import model.serialization.XmlSerializable;
import common.Commons.STATE;
import common.exception.EvaluationException;

public abstract class Evaluator__<T extends Evaluable__ & XmlSerializable,Y>  extends Evaluable__
			implements Iterable<T> {
	

//	public void setState(STATE state)
//	{
//		super._state = state;
//	}
//	
//	public STATE state()
//	{
//		return super.state();
//	}
	
	public abstract T next()throws EvaluationException ; 
	public abstract void put (T value);
	
	public T get(String id) throws UnregisteredComponentException
	{
		T result = null;
		
		Iterator<T> iterator = this.iterator();
		
		while (iterator.hasNext())
		{
			T match = iterator.next();
			
			if (match.id()==id)
			{
				result = match;
			}
		}
		
		return result;
	}
	
	public abstract void reset();
	public abstract T current()throws EvaluationException;
}
